package com.vadimdorofeev.orthodoxlentendays

import org.junit.Assert
import org.junit.Test

class YearInfoUnitTest {

    val refs = listOf<Triple<Int, Int, Int>>(
        Triple(1800, 20, 4),
        Triple(1801, 5, 4),
        Triple(1802, 25, 4),
        Triple(1803, 17, 4),
        Triple(1804, 6, 5),
        Triple(1805, 21, 4),
        Triple(1806, 13, 4),
        Triple(1807, 26, 4),
        Triple(1808, 17, 4),
        Triple(1809, 9, 4),
        Triple(1810, 29, 4),
        Triple(1811, 14, 4),
        Triple(1812, 3, 5),
        Triple(1813, 25, 4),
        Triple(1814, 10, 4),
        Triple(1815, 30, 4),
        Triple(1816, 21, 4),
        Triple(1817, 6, 4),
        Triple(1818, 26, 4),
        Triple(1819, 18, 4),
        Triple(1820, 9, 4),
        Triple(1821, 22, 4),
        Triple(1822, 14, 4),
        Triple(1823, 4, 5),
        Triple(1824, 18, 4),
        Triple(1825, 10, 4),
        Triple(1826, 30, 4),
        Triple(1827, 15, 4),
        Triple(1828, 6, 4),
        Triple(1829, 26, 4),
        Triple(1830, 18, 4),
        Triple(1831, 1, 5),
        Triple(1832, 22, 4),
        Triple(1833, 14, 4),
        Triple(1834, 4, 5),
        Triple(1835, 19, 4),
        Triple(1836, 10, 4),
        Triple(1837, 30, 4),
        Triple(1838, 15, 4),
        Triple(1839, 7, 4),
        Triple(1840, 26, 4),
        Triple(1841, 11, 4),
        Triple(1842, 1, 5),
        Triple(1843, 23, 4),
        Triple(1844, 7, 4),
        Triple(1845, 27, 4),
        Triple(1846, 19, 4),
        Triple(1847, 4, 4),
        Triple(1848, 23, 4),
        Triple(1849, 15, 4),
        Triple(1850, 5, 5),
        Triple(1851, 20, 4),
        Triple(1852, 11, 4),
        Triple(1853, 1, 5),
        Triple(1854, 23, 4),
        Triple(1855, 8, 4),
        Triple(1856, 27, 4),
        Triple(1857, 19, 4),
        Triple(1858, 4, 4),
        Triple(1859, 24, 4),
        Triple(1860, 15, 4),
        Triple(1861, 5, 5),
        Triple(1862, 20, 4),
        Triple(1863, 12, 4),
        Triple(1864, 1, 5),
        Triple(1865, 16, 4),
        Triple(1866, 8, 4),
        Triple(1867, 28, 4),
        Triple(1868, 12, 4),
        Triple(1869, 2, 5),
        Triple(1870, 24, 4),
        Triple(1871, 9, 4),
        Triple(1872, 28, 4),
        Triple(1873, 20, 4),
        Triple(1874, 12, 4),
        Triple(1875, 25, 4),
        Triple(1876, 16, 4),
        Triple(1877, 8, 4),
        Triple(1878, 28, 4),
        Triple(1879, 13, 4),
        Triple(1880, 2, 5),
        Triple(1881, 24, 4),
        Triple(1882, 9, 4),
        Triple(1883, 29, 4),
        Triple(1884, 20, 4),
        Triple(1885, 5, 4),
        Triple(1886, 25, 4),
        Triple(1887, 17, 4),
        Triple(1888, 6, 5),
        Triple(1889, 21, 4),
        Triple(1890, 13, 4),
        Triple(1891, 3, 5),
        Triple(1892, 17, 4),
        Triple(1893, 9, 4),
        Triple(1894, 29, 4),
        Triple(1895, 14, 4),
        Triple(1896, 5, 4),
        Triple(1897, 25, 4),
        Triple(1898, 17, 4),
        Triple(1899, 30, 4),
        Triple(1900, 22, 4),
        Triple(1901, 14, 4),
        Triple(1902, 27, 4),
        Triple(1903, 19, 4),
        Triple(1904, 10, 4),
        Triple(1905, 30, 4),
        Triple(1906, 15, 4),
        Triple(1907, 5, 5),
        Triple(1908, 26, 4),
        Triple(1909, 11, 4),
        Triple(1910, 1, 5),
        Triple(1911, 23, 4),
        Triple(1912, 7, 4),
        Triple(1913, 27, 4),
        Triple(1914, 19, 4),
        Triple(1915, 4, 4),
        Triple(1916, 23, 4),
        Triple(1917, 15, 4),
        Triple(1918, 5, 5),
        Triple(1919, 20, 4),
        Triple(1920, 11, 4),
        Triple(1921, 1, 5),
        Triple(1922, 16, 4),
        Triple(1923, 8, 4),
        Triple(1924, 27, 4),
        Triple(1925, 19, 4),
        Triple(1926, 2, 5),
        Triple(1927, 24, 4),
        Triple(1928, 15, 4),
        Triple(1929, 5, 5),
        Triple(1930, 20, 4),
        Triple(1931, 12, 4),
        Triple(1932, 1, 5),
        Triple(1933, 16, 4),
        Triple(1934, 8, 4),
        Triple(1935, 28, 4),
        Triple(1936, 12, 4),
        Triple(1937, 2, 5),
        Triple(1938, 24, 4),
        Triple(1939, 9, 4),
        Triple(1940, 28, 4),
        Triple(1941, 20, 4),
        Triple(1942, 5, 4),
        Triple(1943, 25, 4),
        Triple(1944, 16, 4),
        Triple(1945, 6, 5),
        Triple(1946, 21, 4),
        Triple(1947, 13, 4),
        Triple(1948, 2, 5),
        Triple(1949, 24, 4),
        Triple(1950, 9, 4),
        Triple(1951, 29, 4),
        Triple(1952, 20, 4),
        Triple(1953, 5, 4),
        Triple(1954, 25, 4),
        Triple(1955, 17, 4),
        Triple(1956, 6, 5),
        Triple(1957, 21, 4),
        Triple(1958, 13, 4),
        Triple(1959, 3, 5),
        Triple(1960, 17, 4),
        Triple(1961, 9, 4),
        Triple(1962, 29, 4),
        Triple(1963, 14, 4),
        Triple(1964, 3, 5),
        Triple(1965, 25, 4),
        Triple(1966, 10, 4),
        Triple(1967, 30, 4),
        Triple(1968, 21, 4),
        Triple(1969, 13, 4),
        Triple(1970, 26, 4),
        Triple(1971, 18, 4),
        Triple(1972, 9, 4),
        Triple(1973, 29, 4),
        Triple(1974, 14, 4),
        Triple(1975, 4, 5),
        Triple(1976, 25, 4),
        Triple(1977, 10, 4),
        Triple(1978, 30, 4),
        Triple(1979, 22, 4),
        Triple(1980, 6, 4),
        Triple(1981, 26, 4),
        Triple(1982, 18, 4),
        Triple(1983, 8, 5),
        Triple(1984, 22, 4),
        Triple(1985, 14, 4),
        Triple(1986, 4, 5),
        Triple(1987, 19, 4),
        Triple(1988, 10, 4),
        Triple(1989, 30, 4),
        Triple(1990, 15, 4),
        Triple(1991, 7, 4),
        Triple(1992, 26, 4),
        Triple(1993, 18, 4),
        Triple(1994, 1, 5),
        Triple(1995, 23, 4),
        Triple(1996, 14, 4),
        Triple(1997, 27, 4),
        Triple(1998, 19, 4),
        Triple(1999, 11, 4),
        Triple(2000, 30, 4),
        Triple(2001, 15, 4),
        Triple(2002, 5, 5),
        Triple(2003, 27, 4),
        Triple(2004, 11, 4),
        Triple(2005, 1, 5),
        Triple(2006, 23, 4),
        Triple(2007, 8, 4),
        Triple(2008, 27, 4),
        Triple(2009, 19, 4),
        Triple(2010, 4, 4),
        Triple(2011, 24, 4),
        Triple(2012, 15, 4),
        Triple(2013, 5, 5),
        Triple(2014, 20, 4),
        Triple(2015, 12, 4),
        Triple(2016, 1, 5),
        Triple(2017, 16, 4),
        Triple(2018, 8, 4),
        Triple(2019, 28, 4),
        Triple(2020, 19, 4),
        Triple(2021, 2, 5),
        Triple(2022, 24, 4),
        Triple(2023, 16, 4),
        Triple(2024, 5, 5),
        Triple(2025, 20, 4),
        Triple(2026, 12, 4),
        Triple(2027, 2, 5),
        Triple(2028, 16, 4),
        Triple(2029, 8, 4),
        Triple(2030, 28, 4),
        Triple(2031, 13, 4),
        Triple(2032, 2, 5),
        Triple(2033, 24, 4),
        Triple(2034, 9, 4),
        Triple(2035, 29, 4),
        Triple(2036, 20, 4),
        Triple(2037, 5, 4),
        Triple(2038, 25, 4),
        Triple(2039, 17, 4),
        Triple(2040, 6, 5),
        Triple(2041, 21, 4),
        Triple(2042, 13, 4),
        Triple(2043, 3, 5),
        Triple(2044, 24, 4),
        Triple(2045, 9, 4),
        Triple(2046, 29, 4),
        Triple(2047, 21, 4),
        Triple(2048, 5, 4),
        Triple(2049, 25, 4),
        Triple(2050, 17, 4),
        Triple(2051, 7, 5),
        Triple(2052, 21, 4),
        Triple(2053, 13, 4),
        Triple(2054, 3, 5),
        Triple(2055, 18, 4),
        Triple(2056, 9, 4),
        Triple(2057, 29, 4),
        Triple(2058, 14, 4),
        Triple(2059, 4, 5),
        Triple(2060, 25, 4),
        Triple(2061, 10, 4),
        Triple(2062, 30, 4),
        Triple(2063, 22, 4),
        Triple(2064, 13, 4),
        Triple(2065, 26, 4),
        Triple(2066, 18, 4),
        Triple(2067, 10, 4),
        Triple(2068, 29, 4),
        Triple(2069, 14, 4),
        Triple(2070, 4, 5),
        Triple(2071, 19, 4),
        Triple(2072, 10, 4),
        Triple(2073, 30, 4),
        Triple(2074, 22, 4),
        Triple(2075, 7, 4),
        Triple(2076, 26, 4),
        Triple(2077, 18, 4),
        Triple(2078, 8, 5),
        Triple(2079, 23, 4),
        Triple(2080, 14, 4),
        Triple(2081, 4, 5),
        Triple(2082, 19, 4),
        Triple(2083, 11, 4),
        Triple(2084, 30, 4),
        Triple(2085, 15, 4),
        Triple(2086, 7, 4),
        Triple(2087, 27, 4),
        Triple(2088, 18, 4),
        Triple(2089, 1, 5),
        Triple(2090, 23, 4),
        Triple(2091, 8, 4),
        Triple(2092, 27, 4),
        Triple(2093, 19, 4),
        Triple(2094, 11, 4),
        Triple(2095, 24, 4),
        Triple(2096, 15, 4),
        Triple(2097, 5, 5),
        Triple(2098, 27, 4),
        Triple(2099, 12, 4),
        Triple(2100, 2, 5)
    )

    @Test
    fun easterDates() {
        for (t in refs) {
            val yi = YearInfo(t.first)
            val easter = yi.getEasterDate()
            val res = easter.monthValue * 100 + easter.dayOfMonth
            if (t.third * 100 + t.second != res) {
                Assert.fail(t.first.toString())
                return
            }
            else
                Assert.assertTrue(t.first.toString(), true)
        }
        Assert.assertTrue(true)
    }
}